<?php
    use admin\assets\AppAsset;
    AppAsset::addJs($this,'/static/js/admin/admin_assign.js');
?>

<div class="container">
    <blockquote class="layui-elem-quote">
        管理员列表 - 编辑管理员
    </blockquote>
    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">*管理员姓名</label>
            <div class="layui-input-inline">
                <input type="hidden" name="id" value="<?php echo $admin['id']; ?>">
                <input type="text" name="name" lay-verify="required" value="<?php echo $admin['name']; ?>" placeholder="请输入管理员姓名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">角色分配</label>
            <div class="layui-input-block">
                <?php foreach($roles as $key=>$val): ?>
                <input type="checkbox" value="<?php echo $key; ?>" name="role_name[]" title="<?php echo $key; ?>" <?php if(in_array($key,$role_list)){echo 'checked';} ?> >
                <?php endforeach; ?>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="admin_submit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>

